﻿using ReflectionStudio.Core.Events;
using System;
using System.ComponentModel;
using System.Data;
using System.Windows;
using WPFExcelReport.Helpers; 
namespace WPFExcelReport
{
    public partial class TDLS02
    { 
        public TDLS02()
        {

            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            MV = new VLIEFDAT();
            this.DataContext = MV;
            InitializeComponent();
        }
        public override void QueryCommand(object sender, RoutedEventArgs e)
        {
            dwData = TBMain.NewRow();
            dwData["LSMANDANT"] = app.Mandant;
            SResult = TMV.QLS99(dwData);
            MergeData(SResult, false);
            base.QueryCommand(sender, e);
        }
        private void LS0Command(object sender, RoutedEventArgs e)
        {
            dwData = TBMain.NewRow();
            TMV.SetUpNewRow(ref dwData, null);
            dwData["LSLIEFNR"] = "00000000";
            TMV.Insert(dwData);
            vwMaster.View.MoveCurrentToFirst();
        }
        public void ResetSeq(object sender, RoutedEventArgs e)
        { 
            VSDDAT.SD22.RESETSEQ("0022", "  ", "LIEFDAT", 1);
            dwData = TBMain.NewRow();
            dwData["LSMANDANT"] = app.Mandant;
            TMV.DLS00(dwData); 
        } 
    }
}
